package com.ypf.demo_ssm.mapper;

import com.ypf.demo_ssm.entity.Order;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ypf.demo_ssm.dto.response.OrderUserVO;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 殷鹏飞
 * @since 2024-06-23
 */
public interface OrderMapper extends BaseMapper<Order> {

    @Select("SELECT o.*, u.username, u.account FROM `order` o LEFT JOIN `user` u ON o.user_id = u.id WHERE o.name LIKE CONCAT('%', IFNULL(#{name}, ''), '%');")
    List<OrderUserVO> queryList(String name);


}
